1. Field of the Invention
The present invention generally relates to a semiconductor device and a method of controlling the semiconductor device, and more particularly, to a semiconductor device having non-volatile memory cells and a method of controlling the semiconductor device.
2. Description of the Related Art
In recent years, non-volatile memories that are semiconductor devices in which data can be rewritten have been widely used for various electronic devices such as portable telephone devices and digital cameras. A flash memory that is a typical non-volatile memory accumulates charges in the charge accumulation layers of the memory cells so as to write data into the memory cells in a non-volatile manner. The data can be erased by eliminating the charges from the charge accumulation layers. Some non-volatile memories have protection functions for prohibiting writing and erasing of data in the memory cells and reading of the data from the memory cells for security reasons.
In this specification, data writing (data being “0”, and the threshold voltage of a subject memory cell being increased) or data erasing (data being “1”, and the threshold voltage of a subject memory cell being lowered) is referred to as “programming”. Also, programming of data in a subject memory cell (data “1” being changed to “0”, or data “0” being changed to “1”), writing of data into a subject memory cell (data “1” being changed to “0”), erasing of data in a subject memory cell (data “0” being changed to “1”), and reading (data “0” or “1” being output) are called memory cell programming, memory cell writing, memory cell erasing, and memory cell reading, respectively. Further, programming, writing, erasing, and reading of data in and from the memory cells in a subject memory region that includes two or more memory cells are called memory region programming, memory region writing, memory region erasing, and memory region reading, respectively.
As a structure for prohibiting reading from memory cells, Japanese Unexamined Patent Publication No. 2003-249080 (Patent Document 1) discloses a non-volatile memory that has a read protection function for prohibiting detection of a memory element with an address signal once the protection function is activated, and has address spaces divided into a space having a read protection function and a space not having a read protection function.
Japanese Unexamined Patent Publication No. 01-266645 (Patent Document 2) discloses a ROM that is equipped with an address change unit for changing an input address to a different address, stores regular data, and protects the regular data by the address change unit outputting an unchanged address only when an input password matches a predetermined password. Japanese Unexamined Patent Publication No. 11-86568 (Patent Document 3) discloses a programmable ROM that stores top-boot type information and bottom-boot type information. This programmable ROM has a switching signal generating circuit 3 that rearranges an address signal A0 . . . Am input in a bottom-boot format into an address in a top-boot format during the final test after the assembling in accordance with the boot-type information written from the outside, and selectively provide the converted address to an address decoder.
In a system including a non-volatile memory that performs read protection through password authentication, regular data stored in the non-volatile memory is protected by a protection function such as a password authenticating function at the time of system boot, as disclosed in Patent Documents 1 and 2. However, in a non-volatile memory that stores a boot code such as code data or program data for booting a system, the boot code needs to be read out without read protection. Furthermore, in a case where regular data and a boot code are stored in the same non-volatile memory, the boot code needs to the stored in all the sectors corresponding to various memory controllers. In other words, it is necessary to record the boot code in different sectors in accordance with the types of memory controllers.
Although the technique disclosed in Patent Document 3 was developed as the means to counter the above problem, it is necessary to secure a process and a storage region for storing the boot type information as to various memory controllers accordingly to Patent Document 3. While disclosing a ROM having address spaces divided into a space having a read protection function and a space not having a read protection function, Patent Document 1 does not disclose a method of processing addresses that vary with the types of memory controllers in the boot-code memory region that is not read-protected. On the other hand, the present invention can provide a semiconductor device and a method of controlling the semiconductor device that can eliminate the necessity of storing data to be read, such as a boot code, in different sectors in accordance with the different types of memory controllers, and can also eliminate the process for writing the boot type information as to the memory controllers of various types from the outside during the final test after the assembling, in a case where the boot code and regular data are stored in the same non-volatile memory.